function draw(data) {
    //定义比例尺和坐标轴
    let xScale = d3.scaleLinear().domain([2000,2007]).range(0,svgWidth - padding.left-padding-right),
    yScale = d3.scaleLinear().domain([0,gdpMax]).range([svgHeight - padding.top - padding.bottom,0]),
    xAxis = d3.axisBottom(xScale),
    yAxis = d3.axisLeft(yScale),
    eleXAxis = this.svg.append(g).attr(
        "transform",
        `translate(${padding.left},${svgHeight - padding.bottom})`
    ).call(xAxis),
    eleYAxis = this.svg.append(g).attr(
        "transform",
        `translate(${padding.left},${padding.top})`
    ).call(yAxis);
    yScale.range([0,svgHeight - padding.top - padding.bottom])
    //定义线段生成器
    let linePath = d3.line().x(d=>xScale(d[0])).y(d=>yScale(d[1])),colors = [d3.rgb(0,0,255),d3.rgb(0,255,0)];
    this.svg.selectAll('path').data(this.dataset).enter().append('path').attr('d',d=>linePath(d.gdp))
    .attr('transform',`translate(${padding.left},${padding.top})`)
    .attr('fill','none')
    .attr('stroke-width',3)
    .attr('stroke',(d,i)=>colors[i])
}
